package com.code.coinprice.services.impl.platform;

import com.code.coinprice.consts.CommonConstant;
import com.code.coinprice.handlers.route.CoinPriceInvokeApiErrorHandler;
import com.code.coinprice.models.CoinPriceSource;
import com.code.coinprice.models.RelativeCoinPrice;
import com.code.coinprice.services.CoinPriceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service(CommonConstant.ZB + CommonConstant.BEAN_NAME_SUFFIX)
public class ZbMarketCoinPriceServiceImpl implements CoinPriceService {

    @Resource
    private CoinPriceInvokeApiErrorHandler coinPriceInvokeApiErrorHandler;

    @Override
    public List<RelativeCoinPrice> getCoinPriceList(CoinPriceSource coinPriceSource) {
        return coinPriceInvokeApiErrorHandler.getCoinPriceList(coinPriceSource);
    }

    @Override
    public String getCoinPrice(String source, String coinType) {
        return coinPriceInvokeApiErrorHandler.getCoinPrice(source, coinType);
    }

}
